This forum is closed to new posts and
responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:
~Elizabeth Elgerosonli 15.Dec.03 11:14 AM a Web browser Applications Development 6.0.2 CF2 iSeries
Hello,
For deploying multiple databases to many people, I have created a setup database.
This setup database shall create local encrypted replicas of the server databases. As we are currently using R5.0.11 for the clients, I can't make this with the standard Lotus Script when using consistent acl over all replicas.
So I decided to use the notes C - API. My Code works in the following way:
1. create a new local database, which is encrypted.
2. Get the replica Info datastructure from the server replic.
3. Set the retrieved replicainfo data structure to the newly created database.
4. Change the ACL of the Server replic by an agent to use the current user as a person entry.
5. Start the first replication.
The routine works well on the Domino Server R5.0.9a for the ISeries.
After the upgrade to R6.0.2CF2. I have problems. The routine seems to delete documents on the server. In the local replic, the documents are existing. When I delete the replicationhistorie on the local replic. All deleted documents are replicated back to the server.
What am I doing wrong? Or is this a problem with R6.0.CF2?
The pgm code for setting the replica info structure follows:
Type TReplicaInfo
ID As TTimeDate
Flags As Long
CutOffIntervall As Long
CutOff As TTimeDate
End Type
Declare Function W32_NSFDbOpen Lib "nnotes.dll" Alias "NSFDbOpen" ( Byval dbName As String, hdb As Long ) As Long
Declare Function W32_NSFDbClose Lib "nnotes.dll" Alias "NSFDbClose" ( Byval hdb As Long ) As Long
Declare Function W32_NSFDbReplicaInfoGet Lib "nnotes.dll" Alias "NSFDbReplicaInfoGet" (Byval hdb As Long, ReplicaInfo As TReplicaInfo) As Long
Declare Function W32_NSFDbReplicaInfoSet Lib "nnotes.dll" Alias "NSFDbReplicaInfoSet" (Byval hdb As Long, ReplicaInfo As TReplicaInfo) As Long
'Constants for nsfdbcreateExtended and local security
Const DBCREATE_LOCALSECURITY = &H0001&
Const DBCREATE_ENCRYPT_MEDIUM = &H0002&
' this are the constants for the db classes
Const DBCLASS_NOTEFILE = &HFF01&
'This are the constants for selectin the documents to replicate.
Const NOTE_CLASS_ALL = &H7FFF&
Const NOTE_CLASS_ALLNONDATA = &H7FFE&
Const NOTE_CLASS_NONE = &H000&
'This are the possible encryption strength in 'Notes
Const DBCOPY_ENCRYPT_SIMPLE = &H40&
Const DBCOPY_ENCRYPT_MEDIUM = &H80&
Const DBCOPY_ENCRYPT_STRONG = &H100&
'Create replic instead of copy
Const DBCOPY_REPLICA = &H1&
Dim ss As NotesSession
Dim Sdb As String
Dim Tdb As String
Dim hdb As Long
Dim strDbInfo As String * 255
Dim strDBtitle As String * 255
Dim strDBtemplate As String * 255
Dim rc As Long
Dim Force As Integer
Sub CreateLocalEncryptedDB(Byval myId As String)
Dim session As New NotesSession
Dim hDB As Long
Dim ret As Integer
Dim mydb As New NotesDatabase("","")
Dim cdb As Notesdatabase
Dim myDoc As NotesDocument
Dim myReplication As NotesReplication
Dim myLog As KEBSalesLog
Dim S_Db As String
Dim D_Db As String
Dim forceCreation As Integer
Dim ReplicaInfo As TReplicaInfo
Dim ReplicaID As TTimeDate
Dim rc As Long
Dim myNameStr As String
Set cdb = session.currentdatabase
Set myLog = New KEBSalesLog("Lokale Replik: Erzeugung einer lokal verschlüsselten Datenbank")
REM Übergabeparameter nutzen um das ParameterDokument mit dem Namen des Erstellers zu bekommen.
REM Das Feld fl_name beinhaltet den Namen desjenigen, der die Datenbank geöffnet hat.
Set myDoc = cdb.GetDocumentbyId(myId)
myNameStr = myDoc.fl_name(0)
'Neue Zuweisung des lokalen Datenbanknamens
'/HP 28.11.2003
If Trim(myDoc.fl_folder(0)) = "" Then
D_DB = myDoc.fl_localdata(0) + "\" + cdb.filename
Else
D_DB = myDoc.fl_localdata(0) + "\" + myDoc.fl_folder(0) + "\" + cdb.filename
End If
REM ***W32 API******W32 API******W32 API******W32 API******W32 API******W32 API******W32 API******W32 API******W32 API***
erzeugt, die zusätzlich verschlüsselt wird.
Print "Bitte warten... lokale Datenbank wird erzeugt!"
REM 0 sollte true sein, oder ???
ForceCreation = 0
'Open local replic
If myDB.Open("", D_DB) Then
Call MyLog.LogAction("Lokale Replik wird zum Replizieren geöffnet!")
Else
Call myLog.LogAction("Lokale Replik konnte nicht geöffnet werden!")
Exit Sub
End If
'Make shure the replication goes over the complete db
'By Setting CutOffDelete to true and finally to false again, the corresponding CutOffDeleteDate
'Is iinitialized to <Space>
Set myReplication = mydb.ReplicationInfo
If myReplication Is Nothing Then Exit Sub